﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraEditors;
using MINERP.BLL.InfoConfig;
using MINERP.DAL;
using MINERP.MODEL.InfoConfig;

namespace MINERP.InfoConfig.Controller
{
    public class CostTypeController
    {
        #region //private fields

        private CostTypeBLL _bll = new CostTypeBLL();
        private GridControl _grid = null;
        private GridView _view = null;
        private ComboBoxEdit _comboBox = null;
        private GroupControl _groupControl = null;
        private CheckEdit _checkEdit = null;

        #endregion


        #region //Public Properties

        internal GroupControl GroupControl
        {
            set
            {
                _groupControl = value;
            }
        }
        internal CheckEdit CheckEdit
        {
            set
            {
                _checkEdit = value;
            }
        }
        internal ComboBoxEdit ComoBox
        {
            set
            {
                _comboBox = value;
            }
        }
        internal GridControl Grid
        {
            set
            {
                _grid = value;
            }
        }

        internal GridView View
        {
            set
            {
                this._view = value;
            }
            get
            {
                return _view;
            }
        }

        #endregion


        #region //Public Methods

        public void GetData()
        {
            _grid.DataSource = _bll.GetCostTypeList();
        }

        public tb_CostType GetCostTypeObj(int id)
        {
            return _bll.GetCostTypeObj(id);
        }
        public void Add(tb_CostType obj)
        {
            _bll.Add(obj);
        }
        public void Update()
        {

            _bll.Update();
        }
        public void Delete(tb_CostType obj)
        {
            _bll.Delete(obj);
        }
        #endregion
    }
}
